/**
 * Generate code from /{{projectName}}-core/src/main/java/{{packageName}}/core/{{modules}}/mapping/{{entities}}InheritMapping.java.hbs
 */
package cn.ibizlab.core.ad.mapping;

import org.mapstruct.*;
import cn.ibizlab.core.ad.domain.SysOrganization;
import cn.ibizlab.core.ad.domain.SysOrganizationalUnit;
import java.util.List;

/**
 * 组织机构继承映射[SysOrganization]
 *
 * @author generator
 */
@Mapper(componentModel = "spring", uses = {})
public interface SysOrganizationInheritMapping {

    /**
     * 转换SysOrganizationalUnit
     * 
     * @param sysOrganization
     * @return
     */
    @Mappings({
            @Mapping(target ="focusNull",ignore = true),
            @Mapping(source ="id",target = "id"),
            @Mapping(source ="parentId",target = "parentId"),
            @Mapping(source ="id",target = "organizationId"),
            @Mapping(source ="sort",target = "sort"),
            @Mapping(source ="dc",target = "dc"),
            @Mapping(source ="description",target = "description"),
            @Mapping(source ="parentName",target = "parentName"),
            @Mapping(source ="organizationName",target = "ou"),
            @Mapping(source ="enabled",target = "enabled"),
    })
    SysOrganizationalUnit toSysOrganizationalUnit(SysOrganization sysOrganization);

    /**
     * 转换SysOrganizationalUnit
     * 
     * @param sysOrganizationalUnit
     * @return
     */
    @Mappings({
            @Mapping(target ="focusNull",ignore = true),
            @Mapping(source ="id",target = "id"),
            @Mapping(source ="parentId",target = "parentId"),
            @Mapping(source ="sort",target = "sort"),
            @Mapping(source ="dc",target = "dc"),
            @Mapping(source ="description",target = "description"),
            @Mapping(source ="parentName",target = "parentName"),
            @Mapping(source ="ou",target = "organizationName"),
            @Mapping(source ="enabled",target = "enabled"),
    })
    SysOrganization toSysOrganization(SysOrganizationalUnit sysOrganizationalUnit);

    /**
     * List SysOrganization 对象转换
     *
     * @param list
     * @return
     */
    List<SysOrganizationalUnit> toSysOrganizationalUnit(List<SysOrganization> list);

    /**
     * List SysOrganizationalUnit 对象转换
     *
     * @param list
     * @return
     */
    List<SysOrganization> toSysOrganization(List<SysOrganizationalUnit> list);

}
